libxl: Replace deprecated "cpu-add" QMP command by "device_add"
authorAnthony PERARD <anthony.perard@citrix.com>
Tue, 11 May 2021 09:28:05 +0000 (10:28 +0100)
committerJulien Grall <jgrall@amazon.com>
Tue, 15 Jun 2021 12:56:26 +0000 (13:56 +0100)
commit4e217db45e83fc3173382306c8b03da86099a25d
treeec24cf58a3b26e5a2a9399d32a2bf09aff44182f
parentf3f778c81769075ac0eb93b98d4b2803e7936453
libxl: Replace deprecated "cpu-add" QMP command by "device_add"

The command "cpu-add" for CPU hotplug is deprecated and has been
removed from QEMU 6.0 (April 2021). We need to add cpus with the
command "device_add" now.

In order to find out which parameters to pass to "device_add" we first
make a call to "query-hotpluggable-cpus" which list the cpus drivers
and properties.

The algorithm to figure out which CPU to add, and by extension if any
CPU needs to be hotplugged, is in the function that adds the cpus.
Because of that, the command "query-hotpluggable-cpus" is always
called, even when not needed.

In case we are using a version of QEMU older than 2.7 (Sept 2016)
which don't have "query-hotpluggable-cpus", we fallback to using
"cpu-add".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
tools/libs/light/libxl_domain.c